package com.fosdata.dpm.services.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fosdata.dpm.domain.SysXbtype;
import com.fosdata.dpm.services.mapper.SysXbtypeMapper;
import com.fosdata.dpm.services.SysXbtypeServices;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 箱变类型表 服务实现类
 * </p>
 *
 * @author gyk
 * @since 2025-10-22
 */
@Service
public class SysXbtypeServicesImpl extends ServiceImpl<SysXbtypeMapper, SysXbtype> implements SysXbtypeServices {


   @Override
   public SysXbtype getByVbCode(String xbCode) {
      try {
         LambdaQueryWrapper<SysXbtype> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(SysXbtype::getXbCode,xbCode);
         return this.baseMapper.selectOne(queryWrapper);
      }catch (Exception e){
         log.error(e.getMessage());
         return new SysXbtype();
      }
   }
}
